package com.hspedu.homework;

public class Homework04 {
    public static void main(String[] args) {
        String str = "asddadsdJJDNBD";
        uppLow(str);

    }

    //判断字符串有多少个大小写字母
    public static void uppLow(String str) {
        if (str == null) {
            System.out.println("输入不能为空");
            return;
        }
        int big = 0, small = 0;
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) >= 'a' && str.charAt(i) <= 'z') {
                small++;
                continue;
            }
            if (str.charAt(i) >= 'A' && str.charAt(i) <= 'Z') {
                big++;
            }
        }
        System.out.println("大写字母" + big + "个，小写字母" + small + "个");
    }
}
